#pragma once

struct vertexdeclaration_t;
struct vertexbuffer_t
{
	uint32 hwid;
	union
	{
		uint32 vdeclid;
		vertexdeclaration_t* vdeclptr;
	};
	union
	{
		uint32 vertexnum;
		uint32 dynamic_offset;
	};

	uint32 vertexsize;
	vertexbuffer_t();
//	vertexbuffer_t(uint32 _vertexnum,vertexdeclaration_t* _vd);
	~vertexbuffer_t();
	void release();
	void init(uint32 _vertexnum,vertexdeclaration_t* _vd);
	void init_dynamic(vertexdeclaration_t* _vd);
	void* lock();
	void* lock_read();
	void* lock(uint32 _vertexnum);
	void unlock();
	void set();


};